#include <iostream>
#include <pthread.h>
#define PI 3.1415926
using std::cout;
using std::endl;

class Circle
{
public:
    Circle()
        :_radius(0)
    {
        cout<<"Circle()"<<endl;
    }

    Circle( double radius)
        :_radius(radius)        
    {
        cout<<"Circle(double)"<<endl;
    }

    double getArea(){
        return PI*_radius*_radius;
    } 

    double getPerimeter(){
        return 2*PI*_radius;
    }

    void show(){
        cout<<"-------------------------------"<<endl;
        cout<<"the circle's Radius: "<<_radius<<endl;
        cout<<"the circle's Perimeter: "<<getPerimeter()<<endl;
        cout<<"the circle's Area: "<<getArea()<<endl;
        cout<<"-------------------------------"<<endl;
    }

private:
    double _radius;
};

class Cylinder:public Circle
{
public:
    Cylinder(double r,double h)
    :Circle(r)
    ,_cHigh(h) 
    {
        cout<<"Cylinder(double,double)"<<endl;
    }

    double getVolume(){
        return _cHigh*Circle::getArea(); 
    }

    void showVolume(){
        cout<<"-------------------------------"<<endl;
        cout<<"the Cylinder's Volume: "<<getVolume()<<endl;
        cout<<"-------------------------------"<<endl;
    }

private:
    double _cHigh;
};

void test(){
    Cylinder c(3.0,4.0);
    c.show();
    c.showVolume();
}

int main()
{


    test ();
    return 0;
}

